Skip to content

BIRMINGHAM | ITP-JAN 26 | Merve Reis | sprint 3 | Alarm clock #1040

Closed
mervereis wants to merge 2 commits intoCodeYourFuture:mainfrom
mervereis:Sprint-3-Alarm-Clock-App
Closed

BIRMINGHAM | ITP-JAN 26 | Merve Reis | sprint 3 | Alarm clock #1040
mervereis wants to merge 2 commits intoCodeYourFuture:mainfrom
mervereis:Sprint-3-Alarm-Clock-App

Conversation

@mervereis
Copy link
Copy Markdown

@mervereis mervereis commented Mar 18, 2026

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

  • setAlarm function created and wrote the alarmclock app
  • Added input validation to handle empty, invalid, and negative values
  • Prevented multiple timers by clearing existing intervals before starting a new one
  • Cached the timeRemaining DOM element to avoid repeated queries
  • Handled decimal inputs by rounding down to the nearest second
  • Added tests for edge cases (invalid input, negative values, decimals)

@mervereis mervereis added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Groups The name of the module. labels Mar 18, 2026
@mervereis mervereis changed the title BIRMINGHAM | ITP 26 | Merve Reis | sprint 3 | Alarm clock BIRMINGHAM | ITP-JAN 26 | Merve Reis | sprint 3 | Alarm clock Mar 18, 2026
@hkavalikas hkavalikas self-requested a review March 22, 2026 11:55
@hkavalikas hkavalikas added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 22, 2026
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will happen if we pass an empty or negative argument as the input?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hkavalikas I added validation to prevent empty, invalid, or negative inputs from starting the timer.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will happen if I click on Set alarm multiple times? How can we improve that?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hkavalikas I now clear any existing interval before starting a new one so multiple clicks don’t create overlapping timers.

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
let seconds = Number(document.getElementById("alarmSet").value);

// Update the heading to show the starting time
document.getElementById("timeRemaining").innerText =
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using this DOM query in a few places, how can we improve/reuse it instead?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hkavalikas I assigned the timeRemaining element to a variable and reused it for avoid querying the DOM multiple times and improve code reuse.

@hkavalikas hkavalikas added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 22, 2026
@hkavalikas
Copy link
Copy Markdown

Can we add a Changelist in this PR noting down the changes made?

@mervereis
Copy link
Copy Markdown
Author

Can we add a Changelist in this PR noting down the changes made?

Added a changelist to pr description

@hkavalikas hkavalikas added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 26, 2026
@illicitonion
Copy link
Copy Markdown
Member

Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. Module-Data-Groups The name of the module. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants